-- GENERATED SPELL FOR [Fathom-Guard Tidalvess] --


function spell0_21965(pUnit, Event) --@Blessing of the Tides,n/a--
pUnit:FullCastSpellOnTarget(38449,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21965', 562, 1)
end

function spell1_21965(pUnit, Event) --@Earthbind Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(38304,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_21965', 1, 1)
end

function spell2_21965(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(38234,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21965', 8324, 1)
end

function spell3_21965(pUnit, Event) --@Poison Cleansing Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(38306,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_21965', 1, 1)
end

function spell4_21965(pUnit, Event) --@Power of Tidalvess,n/a--
pUnit:FullCastSpellOnTarget(38452,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21965', 0, 1)
end

function spell5_21965(pUnit, Event) --@Spitfire Totem,Self--
pUnit:FullCastSpellOnTarget(38236,pUnit)
pUnit:RegisterEvent('Sorts_21965', 586, 1)
end

function Sorts_21965(pUnit, Event)
local choix_sorts_21965 = math.random(0, 5)
if choix_sorts_21965 == 0 then
pUnit:RegisterEvent('spell0_21965', 1, 1)
end
if choix_sorts_21965 == 1 then
pUnit:RegisterEvent('spell1_21965', 1, 1)
end
if choix_sorts_21965 == 2 then
pUnit:RegisterEvent('spell2_21965', 1, 1)
end
if choix_sorts_21965 == 3 then
pUnit:RegisterEvent('spell3_21965', 1, 1)
end
if choix_sorts_21965 == 4 then
pUnit:RegisterEvent('spell4_21965', 1, 1)
end
if choix_sorts_21965 == 5 then
pUnit:RegisterEvent('spell5_21965', 1, 1)
end
end

function mob21965_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21965', math.random(1500, 3000), 1)
end

function mob21965_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21965_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21965_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21965, 1, 'mob21965_Action')
RegisterUnitEvent(21965, 2, 'mob21965_Leave')
RegisterUnitEvent(21965, 3, 'mob21965_Kill')
RegisterUnitEvent(21965, 4, 'mob21965_Die')
